package session

//import "sync"

var (
	sessionMgr SessionMgr
)

func Init(provider string, adress string, options ...interface{}) (err error) {
	switch provider {
	case "memory":
		sessionMgr = NewMemorySessionMgr()
	case "redis":
		sessionMgr = NewRedisSessionMgr()
	default:
		err = ErrSessionProviderNotSupport
	}
	if err != nil {
		return
	}
	err = sessionMgr.Init(adress, options...)
	return
}
